package main

import (
	"demo/kongganghelper/config"
	logger "demo/kongganghelper/log"
	"demo/kongganghelper/sdk"
	log "github.com/sirupsen/logrus"
)

func main() {
	defer func() {
		if err := recover(); err != nil {
			log.Error(err)
		}
	}()

	//初始化配置文件
	config.Init()
	//初始化日志框架
	logger.Init()

	sdk.GetProductTypeList()
	user := sdk.Login("15528167867", "kg408489044")
	goods := sdk.GetHomeRecommend(user)
	if user != nil {
		sdk.GetShopCard(user)
		sdk.CostCalculation(user, goods[0], 1)
		address := sdk.GetAddress(user)
		sdk.PaymentAdditional(user)
		sdk.ProductBuyLimit(user)
		sdk.PurchaseExchange(user)
		sdk.CheckRestrictedArea(user, goods[0], address[0])
		sdk.GetProductDetail(user, goods[0])
		sdk.PurchasePlaceOrder(user, goods[0], address[0], 1)
		sdk.GetProductDetail0(user)
	}

	for {
	}
}
